package com.heima.model.user.dtos;

import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class LoginDTO  {

    /**
     * 设备id
     */
    private Integer equipmentId;

    /**
     * 手机号
     */
    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = "^((13[0-9])|(14[5|7|9])|(15([0-9])|(17[0-9])|(18[0-9])|(19[8|9]))\\d{8})$",message = "手机号格式不正确")
    private String phone;

    /**
     * 密码
     */
    private String password;
    /**
     *验证码
     * */

    @NotNull(message = "验证码不能为空")
    @Range(min = 1000,max = 9999,message = "验证码格式有误")
    private Short code;

}